﻿using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.ModelConfiguration.Conventions;
using RN.ERP.Entity;
using RN.ERP.Entity.QD;
using Fly.Log;
using RN.ERP.Entity.ResultModels;
using RN.ERP.Entity.Authority;

namespace RN.ERP.DAL
{
    /// <summary>
    /// 临时提供满足青岛业务需求的企业人员查询方法。
    /// </summary>
    public class QD_Context : DbContext
    {
        private const string CONNECTION_STRING_NAME = "name=QdConnectionString";

        public QD_Context()
            : base(CONNECTION_STRING_NAME)
        {
            Database.SetInitializer<QD_Context>(null);
        }

        #region 实体操作集合

        /// <summary>
        /// 用户表。
        /// </summary>
        public DbSet<T_Sys_Users> T_Sys_Users { get; set; }
        /// <summary>
        /// 企业信息表。
        /// </summary>
        public DbSet<Tb_Corp_CompanyInfo> Corp_CompanyInfos { get; set; }
        public DbSet<tb_Corp_CompanyInfo_wdrq> Corp_CompanyInfosWdrq { get; set; }
        public DbSet<tb_Corp_Quality> Corp_CompanyQualities { get; set; }
        /// <summary>
        /// 人员表。
        /// </summary>
        public DbSet<tb_Emp_Manager> Emp_Manager { get; set; }
        /// <summary>
        /// 企业管理人员
        /// </summary>
        public DbSet<tb_Emp_Employee> Emp_Employee { get; set; }
        /// <summary>
        /// 状态表。
        /// </summary>
        public DbSet<Tb_FlowCode> FlowCodes { get; set; }

        public DbSet<Tb_ChangeItem> ChangeItems { get; set; }
        public DbSet<Tb_ChangeItemSub> ChangeItemSubs { get; set; }
        public DbSet<Tb_ChangeRecord> ChangeRecords { get; set; }
        public DbSet<T_Sys_Dictionary> Dictionarys { get; set; }
        public DbSet<V_ChangeInfo> ChangeSetInfo { get; set; }
        public DbSet<Kh_CorpTable> SecurityInfo { get; set; }
        /// <summary>
        /// 人员资格证书。
        /// </summary>
        public DbSet<Tb_Emp_TitleDetails> Emp_Qualities { get; set; }
        /// <summary>
        /// 项目经理B证。
        /// </summary>
        public DbSet<Tb_Emp_TitleDetailsExt> BCards { get; set; }

        public DbSet<Tb_ChangeSetRecord> ChangeSetRecords { get; set; }

        /// <summary>
        /// 查询项目负责人基本信息，用于处理押证流程
        /// </summary>
        //public DbSet<V_CheckXMFZR> CheckXMFZR { get; set; }

        public DbSet<tb_Corp_CompanyInfo_wdrq_employee> CompanyInfo_wdrq { get; set; }

        /// <summary>
        /// 主要工作经历
        /// </summary>
        public DbSet<tb_WorkExperience> WorkExperience { get; set; }
        public DbSet<tb_Corp_CorpKind> CorpKind { get; set; }

        /// <summary>
        /// 押证表
        /// </summary>
        public DbSet<zb_emp_LockCertificate> LockCertificate { get; set; }

        public DbSet<e_SorcePublish_2006> SorcePublish { get; set; }
        /// <summary>
        /// 去年考核分表
        /// </summary>
        public DbSet<e_SorcePublish_2006backup> LastYearSorcePublish { get; set; }

        public DbSet<Zb_TempLock_Qd> ZbTempLock { get; set; }

        public DbSet<tb_emp_ManagerRole> ManagerRole { get; set; }

        public DbSet<e_OuterPrize> e_Outerprize { get; set; }
        public DbSet<e_ProjectPrizePunish> ProjectPrizePunish { get; set; }
        
        public DbSet<v_e_DeDuck> Punishment { get; set; }

        public DbSet<Tb_Corp_ProfitTotal> ProfitTotal { get; set; }
        public DbSet<Tb_Corp_ProfitTotal_View> ProfitTotal_View { get; set; }
        public DbSet<Tb_Corp_ProfitTotalGuid_View> ProfitTotalGuid_View { get; set; }
        public DbSet<e_PrizeFlag> PrizeFlag { get; set; }
        public DbSet<a_StructKind> a_StructKind { get; set; }
        public DbSet<a_zjjg> a_zjjg { get; set; }
        public DbSet<a_AreaSSQ> a_AreaSSQ { get; set; }
        public DbSet<T_Sys_Roles> SysRoles { get; set; }
        public DbSet<T_Sys_UserRole> SysUserRoles { get; set; }
        public DbSet<T_Sys_Function> SysFunction { get; set; }
        public DbSet<T_Sys_Control> SysControl { get; set; }
        public DbSet<T_Sys_ControlFunction> SysConFunction { get; set; }
        public DbSet<tbCorpList> tbCorpList { get; set; }
        public DbSet<Tb_emp_ManagerCertCount> emp_ManagerCertCount { get; set; }
        public DbSet<Notice> Notice { get; set; }
        /// <summary>
        /// 人员转入视图查询
        /// </summary>
        public DbSet<V_PersonToEntryList> VPersonToEntryList { get; set; }
        public DbSet<T_Sys_Dict_Qd> Dictionary { get; set; }
        public DbSet<T_Sys_DictRelation_Qd> DictionaryRelation { get; set; }
        public DbSet<a_AreaInfo> AreaInfo { get; set; }
        public DbSet<a_AreaSubInfo> AreaSubInfo { get; set; }
        public DbSet<T_Sys_FuncPermission> SysFuncPermission { get; set; }
        public DbSet<tb_Emp_TitleClass> tb_Emp_TitleClass { get; set; }
        public DbSet<tb_Emp_TitleType> tb_Emp_TitleType { get; set; }
        public DbSet<ReceiveNotice> receiveNotice { get; set; }
        public DbSet<a_KhUserDefine_QD> UserDefineQD { get; set; }
        public DbSet<e_SckhVerSumClass> SckhVerSumClass { get; set; }

        public DbSet<V_ManagerList> V_ManagerList { get; set; }

        public DbSet<e_PrizeBZH> ePrizeBZH { get; set; }

        public DbSet<dict_Department_QD> DictDepartmentQD { get; set; }

       
        #endregion

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
